package com.xb.loan.util.binaryConvert.parse.num;


import com.xb.loan.util.binaryConvert.config.ParseConfig;
import com.xb.loan.util.binaryConvert.parse.ParseAble;
import com.xb.loan.util.binaryConvert.parse.ParsePointer;

public class ByteParser implements ParseAble<Byte> {

	@Override
	public Byte convert(byte[] b, ParsePointer pointer, Class<?> clazz, ParseConfig config) {
		
		byte result = b[pointer.getPointer()];
		// 指针向后移动一个字节
		pointer.move(1);
		
		return result;
	}

	@Override
	public byte[] format(Byte obj,ParseConfig config) {
		
		return new byte[]{obj};
	}

}
